package simpledb.server.drivers;

import simpledb.file.Block;
import simpledb.server.SimpleDB;
import simpledb.tx.Transaction;

/*
 * Iterates through six blocks and displays their values.
 */


public class TestDriver3 {

	public static void main(String[] args) {
		
		SimpleDB.init("dbdir");
		String filename = "testdbdir.tbl";
		Block[] blks = new Block[6];
		int blockOffset = 4;
		
		for (int i = 0 ; i < 6 ; i ++) {
			blks[i] = new Block(filename, i);
		}	
		
		Transaction t = new Transaction();
		
		for (int i = 0 ; i < 6 ; i ++) {
			t.pin(blks[i]);
			int a = t.getInt(blks[i], blockOffset);
			System.out.println(blks[i] + "  -->  " + a);
			t.unpin(blks[i]);
		}	
	}
}
